// Copyright Epic Games, Inc. All Rights Reserved.

#include "CustomSettings/LyraSettingValueDiscreteDynamic_AudioOutputDevice.h"
#include "DataSource/GameSettingDataSource.h"
#include "EditCondition/WhenCondition.h"
#include "EditCondition/WhenPlatformHasTrait.h"
#include "EditCondition/WhenPlayingAsPrimaryPlayer.h"
#include "GameSettingCollection.h"
#include "GameSettingValueScalarDynamic.h"
#include "LyraGameSettingRegistry.h"
#include "LyraSettingsLocal.h"
#include "LyraSettingsShared.h"
#include "NativeGameplayTags.h"
#include "Player/LyraLocalPlayer.h"

class ULocalPlayer;

#define LOCTEXT_NAMESPACE "Lyra"

// 定义平台特性标签
UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_Platform_Trait_SupportsChangingAudioOutputDevice, "Platform.Trait.SupportsChangingAudioOutputDevice"); // 支持更改音频输出设备平台特性标签
UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_Platform_Trait_SupportsBackgroundAudio, "Platform.Trait.SupportsBackgroundAudio"); // 支持后台音频平台特性标签

/**
 * 初始化音频设置
 * @param InLocalPlayer 本地玩家
 * @return 游戏设置集合
 */
UGameSettingCollection* ULyraGameSettingRegistry::InitializeAudioSettings(ULyraLocalPlayer* InLocalPlayer)
{
	UGameSettingCollection* Screen = NewObject<UGameSettingCollection>(); // 创建游戏设置集合
	Screen->SetDevName(TEXT("AudioCollection")); // 设置开发名称
	Screen->SetDisplayName(LOCTEXT("AudioCollection_Name", "Audio")); // 设置显示名称
	Screen->Initialize(InLocalPlayer); // 初始化

	// 音量
	////////////////////////////////////////////////////////////////////////////////////
	{
		UGameSettingCollection* Volume = NewObject<UGameSettingCollection>(); // 创建音量设置集合
		Volume->SetDevName(TEXT("VolumeCollection")); // 设置开发名称
		Volume->SetDisplayName(LOCTEXT("VolumeCollection_Name", "Volume")); // 设置显示名称
		Screen->AddSetting(Volume); // 添加到屏幕设置

		//----------------------------------------------------------------------------------
		{
			UGameSettingValueScalarDynamic* Setting = NewObject<UGameSettingValueScalarDynamic>(); // 创建标量动态值设置
			Setting->SetDevName(TEXT("OverallVolume")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("OverallVolume_Name", "Overall")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("OverallVolume_Description", "Adjusts the volume of everything.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(GetOverallVolume)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetOverallVolume)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->GetOverallVolume()); // 设置默认值
			Setting->SetDisplayFormat(UGameSettingValueScalarDynamic::ZeroToOnePercent); // 设置显示格式

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Volume->AddSetting(Setting); // 添加到音量设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueScalarDynamic* Setting = NewObject<UGameSettingValueScalarDynamic>(); // 创建标量动态值设置
			Setting->SetDevName(TEXT("MusicVolume")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("MusicVolume_Name", "Music")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("MusicVolume_Description", "Adjusts the volume of music.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(GetMusicVolume)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetMusicVolume)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->GetMusicVolume()); // 设置默认值
			Setting->SetDisplayFormat(UGameSettingValueScalarDynamic::ZeroToOnePercent); // 设置显示格式

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Volume->AddSetting(Setting); // 添加到音量设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueScalarDynamic* Setting = NewObject<UGameSettingValueScalarDynamic>(); // 创建标量动态值设置
			Setting->SetDevName(TEXT("SoundEffectsVolume")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("SoundEffectsVolume_Name", "Sound Effects")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("SoundEffectsVolume_Description", "Adjusts the volume of sound effects.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(GetSoundFXVolume)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetSoundFXVolume)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->GetSoundFXVolume()); // 设置默认值
			Setting->SetDisplayFormat(UGameSettingValueScalarDynamic::ZeroToOnePercent); // 设置显示格式

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Volume->AddSetting(Setting); // 添加到音量设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueScalarDynamic* Setting = NewObject<UGameSettingValueScalarDynamic>(); // 创建标量动态值设置
			Setting->SetDevName(TEXT("DialogueVolume")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("DialogueVolume_Name", "Dialogue")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("DialogueVolume_Description", "Adjusts the volume of dialogue for game characters and voice overs.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(GetDialogueVolume)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetDialogueVolume)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->GetDialogueVolume()); // 设置默认值
			Setting->SetDisplayFormat(UGameSettingValueScalarDynamic::ZeroToOnePercent); // 设置显示格式

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Volume->AddSetting(Setting); // 添加到音量设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueScalarDynamic* Setting = NewObject<UGameSettingValueScalarDynamic>(); // 创建标量动态值设置
			Setting->SetDevName(TEXT("VoiceChatVolume")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("VoiceChatVolume_Name", "Voice Chat")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("VoiceChatVolume_Description", "Adjusts the volume of voice chat.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(GetVoiceChatVolume)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetVoiceChatVolume)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->GetVoiceChatVolume()); // 设置默认值
			Setting->SetDisplayFormat(UGameSettingValueScalarDynamic::ZeroToOnePercent); // 设置显示格式

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Volume->AddSetting(Setting); // 添加到音量设置
		}
	}


	// 声音
	////////////////////////////////////////////////////////////////////////////////////
	{
		UGameSettingCollection* Sound = NewObject<UGameSettingCollection>(); // 创建声音设置集合
		Sound->SetDevName(TEXT("SoundCollection")); // 设置开发名称
		Sound->SetDisplayName(LOCTEXT("SoundCollection_Name", "Sound")); // 设置显示名称
		Screen->AddSetting(Sound); // 添加到屏幕设置

		//----------------------------------------------------------------------------------
		{
			UGameSettingCollectionPage* SubtitlePage = NewObject<UGameSettingCollectionPage>(); // 创建字幕设置页面
			SubtitlePage->SetDevName(TEXT("SubtitlePage")); // 设置开发名称
			SubtitlePage->SetDisplayName(LOCTEXT("SubtitlePage_Name", "Subtitles")); // 设置显示名称
			SubtitlePage->SetDescriptionRichText(LOCTEXT("SubtitlePage_Description", "Configure the visual appearance of subtitles.")); // 设置描述富文本
			SubtitlePage->SetNavigationText(LOCTEXT("SubtitlePage_Navigation", "Options")); // 设置导航文本

			SubtitlePage->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Sound->AddSetting(SubtitlePage); // 添加到声音设置

			// 字幕
			////////////////////////////////////////////////////////////////////////////////////
			{
				UGameSettingCollection* SubtitleCollection = NewObject<UGameSettingCollection>(); // 创建字幕设置集合
				SubtitleCollection->SetDevName(TEXT("SubtitlesCollection")); // 设置开发名称
				SubtitleCollection->SetDisplayName(LOCTEXT("SubtitlesCollection_Name", "Subtitles")); // 设置显示名称
				SubtitlePage->AddSetting(SubtitleCollection); // 添加到字幕页面

				//----------------------------------------------------------------------------------
				{
					UGameSettingValueDiscreteDynamic_Bool* Setting = NewObject<UGameSettingValueDiscreteDynamic_Bool>(); // 创建布尔离散值设置
					Setting->SetDevName(TEXT("Subtitles")); // 设置开发名称
					Setting->SetDisplayName(LOCTEXT("Subtitles_Name", "Subtitles")); // 设置显示名称
					Setting->SetDescriptionRichText(LOCTEXT("Subtitles_Description", "Turns subtitles on/off.")); // 设置描述富文本

					Setting->SetDynamicGetter(GET_SHARED_SETTINGS_FUNCTION_PATH(GetSubtitlesEnabled)); // 设置动态获取器
					Setting->SetDynamicSetter(GET_SHARED_SETTINGS_FUNCTION_PATH(SetSubtitlesEnabled)); // 设置动态设置器
					Setting->SetDefaultValue(GetDefault<ULyraSettingsShared>()->GetSubtitlesEnabled()); // 设置默认值

					SubtitleCollection->AddSetting(Setting); // 添加到字幕集合
				}
				//----------------------------------------------------------------------------------
				{
					UGameSettingValueDiscreteDynamic_Enum* Setting = NewObject<UGameSettingValueDiscreteDynamic_Enum>(); // 创建枚举离散值设置
					Setting->SetDevName(TEXT("SubtitleTextSize")); // 设置开发名称
					Setting->SetDisplayName(LOCTEXT("SubtitleTextSize_Name", "Text Size")); // 设置显示名称
					Setting->SetDescriptionRichText(LOCTEXT("SubtitleTextSize_Description", "Choose different sizes of the the subtitle text.")); // 设置描述富文本

					Setting->SetDynamicGetter(GET_SHARED_SETTINGS_FUNCTION_PATH(GetSubtitlesTextSize)); // 设置动态获取器
					Setting->SetDynamicSetter(GET_SHARED_SETTINGS_FUNCTION_PATH(SetSubtitlesTextSize)); // 设置动态设置器
					Setting->SetDefaultValue(GetDefault<ULyraSettingsShared>()->GetSubtitlesTextSize()); // 设置默认值
					Setting->AddEnumOption(ESubtitleDisplayTextSize::ExtraSmall, LOCTEXT("ESubtitleTextSize_ExtraSmall", "Extra Small")); // 添加特小选项
					Setting->AddEnumOption(ESubtitleDisplayTextSize::Small, LOCTEXT("ESubtitleTextSize_Small", "Small")); // 添加小选项
					Setting->AddEnumOption(ESubtitleDisplayTextSize::Medium, LOCTEXT("ESubtitleTextSize_Medium", "Medium")); // 添加中等选项
					Setting->AddEnumOption(ESubtitleDisplayTextSize::Large, LOCTEXT("ESubtitleTextSize_Large", "Large")); // 添加大选项
					Setting->AddEnumOption(ESubtitleDisplayTextSize::ExtraLarge, LOCTEXT("ESubtitleTextSize_ExtraLarge", "Extra Large")); // 添加特大选项

					SubtitleCollection->AddSetting(Setting); // 添加到字幕集合
				}
				//----------------------------------------------------------------------------------
				{
					UGameSettingValueDiscreteDynamic_Enum* Setting = NewObject<UGameSettingValueDiscreteDynamic_Enum>(); // 创建枚举离散值设置
					Setting->SetDevName(TEXT("SubtitleTextColor")); // 设置开发名称
					Setting->SetDisplayName(LOCTEXT("SubtitleTextColor_Name", "Text Color")); // 设置显示名称
					Setting->SetDescriptionRichText(LOCTEXT("SubtitleTextColor_Description", "Choose different colors for the subtitle text.")); // 设置描述富文本

					Setting->SetDynamicGetter(GET_SHARED_SETTINGS_FUNCTION_PATH(GetSubtitlesTextColor)); // 设置动态获取器
					Setting->SetDynamicSetter(GET_SHARED_SETTINGS_FUNCTION_PATH(SetSubtitlesTextColor)); // 设置动态设置器
					Setting->SetDefaultValue(GetDefault<ULyraSettingsShared>()->GetSubtitlesTextColor()); // 设置默认值
					Setting->AddEnumOption(ESubtitleDisplayTextColor::White, LOCTEXT("ESubtitleTextColor_White", "White")); // 添加白色选项
					Setting->AddEnumOption(ESubtitleDisplayTextColor::Yellow, LOCTEXT("ESubtitleTextColor_Yellow", "Yellow")); // 添加黄色选项

					SubtitleCollection->AddSetting(Setting); // 添加到字幕集合
				}
				//----------------------------------------------------------------------------------
				{
					UGameSettingValueDiscreteDynamic_Enum* Setting = NewObject<UGameSettingValueDiscreteDynamic_Enum>(); // 创建枚举离散值设置
					Setting->SetDevName(TEXT("SubtitleTextBorder")); // 设置开发名称
					Setting->SetDisplayName(LOCTEXT("SubtitleBackgroundStyle_Name", "Text Border")); // 设置显示名称
					Setting->SetDescriptionRichText(LOCTEXT("SubtitleTextBorder_Description", "Choose different borders for the text.")); // 设置描述富文本

					Setting->SetDynamicGetter(GET_SHARED_SETTINGS_FUNCTION_PATH(GetSubtitlesTextBorder)); // 设置动态获取器
					Setting->SetDynamicSetter(GET_SHARED_SETTINGS_FUNCTION_PATH(SetSubtitlesTextBorder)); // 设置动态设置器
					Setting->SetDefaultValue(GetDefault<ULyraSettingsShared>()->GetSubtitlesTextBorder()); // 设置默认值
					Setting->AddEnumOption(ESubtitleDisplayTextBorder::None, LOCTEXT("ESubtitleTextBorder_None", "None")); // 添加无边框选项
					Setting->AddEnumOption(ESubtitleDisplayTextBorder::Outline, LOCTEXT("ESubtitleTextBorder_Outline", "Outline")); // 添加轮廓选项
					Setting->AddEnumOption(ESubtitleDisplayTextBorder::DropShadow, LOCTEXT("ESubtitleTextBorder_DropShadow", "Drop Shadow")); // 添加投影选项

					SubtitleCollection->AddSetting(Setting); // 添加到字幕集合
				}
				//----------------------------------------------------------------------------------
				{
					UGameSettingValueDiscreteDynamic_Enum* Setting = NewObject<UGameSettingValueDiscreteDynamic_Enum>(); // 创建枚举离散值设置
					Setting->SetDevName(TEXT("SubtitleBackgroundOpacity")); // 设置开发名称
					Setting->SetDisplayName(LOCTEXT("SubtitleBackground_Name", "Background Opacity")); // 设置显示名称
					Setting->SetDescriptionRichText(LOCTEXT("SubtitleBackgroundOpacity_Description", "Choose a different background or letterboxing for the subtitles.")); // 设置描述富文本

					Setting->SetDynamicGetter(GET_SHARED_SETTINGS_FUNCTION_PATH(GetSubtitlesBackgroundOpacity)); // 设置动态获取器
					Setting->SetDynamicSetter(GET_SHARED_SETTINGS_FUNCTION_PATH(SetSubtitlesBackgroundOpacity)); // 设置动态设置器
					Setting->SetDefaultValue(GetDefault<ULyraSettingsShared>()->GetSubtitlesBackgroundOpacity()); // 设置默认值
					Setting->AddEnumOption(ESubtitleDisplayBackgroundOpacity::Clear, LOCTEXT("ESubtitleBackgroundOpacity_Clear", "Clear")); // 添加透明选项
					Setting->AddEnumOption(ESubtitleDisplayBackgroundOpacity::Low, LOCTEXT("ESubtitleBackgroundOpacity_Low", "Low")); // 添加低不透明度选项
					Setting->AddEnumOption(ESubtitleDisplayBackgroundOpacity::Medium, LOCTEXT("ESubtitleBackgroundOpacity_Medium", "Medium")); // 添加中等不透明度选项
					Setting->AddEnumOption(ESubtitleDisplayBackgroundOpacity::High, LOCTEXT("ESubtitleBackgroundOpacity_High", "High")); // 添加高不透明度选项
					Setting->AddEnumOption(ESubtitleDisplayBackgroundOpacity::Solid, LOCTEXT("ESubtitleBackgroundOpacity_Solid", "Solid")); // 添加实心选项

					SubtitleCollection->AddSetting(Setting); // 添加到字幕集合
				}
			}
		}
		//----------------------------------------------------------------------------------
		{
			ULyraSettingValueDiscreteDynamic_AudioOutputDevice* Setting = NewObject<ULyraSettingValueDiscreteDynamic_AudioOutputDevice>(); // 创建音频输出设备离散值设置
			Setting->SetDevName(TEXT("AudioOutputDevice")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("AudioOutputDevice_Name", "Audio Output Device")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("AudioOutputDevice_Description", "Changes the audio output device for game audio (not voice chat).")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(GetAudioOutputDeviceId)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetAudioOutputDeviceId)); // 设置动态设置器

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件
			Setting->AddEditCondition(FWhenPlatformHasTrait::KillIfMissing( // 添加编辑条件
				TAG_Platform_Trait_SupportsChangingAudioOutputDevice,
				TEXT("Platform does not support changing audio output device")) // 平台不支持更改音频输出设备
			);

			Sound->AddSetting(Setting); // 添加到声音设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueDiscreteDynamic_Enum* Setting = NewObject<UGameSettingValueDiscreteDynamic_Enum>(); // 创建枚举离散值设置
			Setting->SetDevName(TEXT("BackgroundAudio")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("BackgroundAudio_Name", "Background Audio")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("BackgroundAudio_Description", "Turns game audio on/off when the game is in the background. When on, the game audio will continue to play when the game is minimized, or another window is focused.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_SHARED_SETTINGS_FUNCTION_PATH(GetAllowAudioInBackgroundSetting)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_SHARED_SETTINGS_FUNCTION_PATH(SetAllowAudioInBackgroundSetting)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsShared>()->GetAllowAudioInBackgroundSetting()); // 设置默认值

			Setting->AddEnumOption(ELyraAllowBackgroundAudioSetting::Off, LOCTEXT("ELyraAllowBackgroundAudioSetting_Off", "Off")); // 添加关闭选项
			Setting->AddEnumOption(ELyraAllowBackgroundAudioSetting::AllSounds, LOCTEXT("ELyraAllowBackgroundAudioSetting_AllSounds", "All Sounds")); // 添加所有声音选项

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件
			Setting->AddEditCondition(FWhenPlatformHasTrait::KillIfMissing( // 添加编辑条件
				TAG_Platform_Trait_SupportsBackgroundAudio,
				TEXT("Platform does not support background audio")) // 平台不支持后台音频
			);

			Sound->AddSetting(Setting); // 添加到声音设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueDiscreteDynamic_Bool* Setting = NewObject<UGameSettingValueDiscreteDynamic_Bool>(); // 创建布尔离散值设置
			Setting->SetDevName(TEXT("HeadphoneMode")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("HeadphoneMode_Name", "3D Headphones")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("HeadphoneMode_Description", "Enable binaural audio.  Provides 3D audio spatialization, so you can hear the location of sounds more precisely, including above, below, and behind you. Recommended for use with stereo headphones only.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(bDesiredHeadphoneMode)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(bDesiredHeadphoneMode)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->IsHeadphoneModeEnabled()); // 设置默认值

			Setting->AddEditCondition(MakeShared<FWhenCondition>( // 添加编辑条件
				[](const ULocalPlayer*, FGameSettingEditableState& InOutEditState)
				{
					if (!GetDefault<ULyraSettingsLocal>()->CanModifyHeadphoneModeEnabled()) // 如果无法修改耳机模式启用状态
					{
						InOutEditState.Kill(TEXT("Binaural Spatialization option cannot be modified on this platform")); // 禁用设置
					}
				}));

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Sound->AddSetting(Setting); // 添加到声音设置
		}
		//----------------------------------------------------------------------------------
		{
			UGameSettingValueDiscreteDynamic_Bool* Setting = NewObject<UGameSettingValueDiscreteDynamic_Bool>(); // 创建布尔离散值设置
			Setting->SetDevName(TEXT("HDRAudioMode")); // 设置开发名称
			Setting->SetDisplayName(LOCTEXT("HDRAudioMode_Name", "High Dynamic Range Audio")); // 设置显示名称
			Setting->SetDescriptionRichText(LOCTEXT("HDRAudioMode_Description", "Enable high dynamic range audio. Changes the runtime processing chain to increase the dynamic range of the audio mixdown, appropriate for theater or more cinematic experiences.")); // 设置描述富文本

			Setting->SetDynamicGetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(bUseHDRAudioMode)); // 设置动态获取器
			Setting->SetDynamicSetter(GET_LOCAL_SETTINGS_FUNCTION_PATH(SetHDRAudioModeEnabled)); // 设置动态设置器
			Setting->SetDefaultValue(GetDefault<ULyraSettingsLocal>()->IsHDRAudioModeEnabled()); // 设置默认值

			Setting->AddEditCondition(FWhenPlayingAsPrimaryPlayer::Get()); // 添加编辑条件

			Sound->AddSetting(Setting); // 添加到声音设置
		}
		//----------------------------------------------------------------------------------
	}

	return Screen; // 返回屏幕设置集合
}

#undef LOCTEXT_NAMESPACE